<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="lib/css/bootstrap.css">
    <title>问题页面</title>
    <style>
        .container-box {
            margin-top: 70px;
        }

        .save {
            /* width: 946px; */
            font-size: 20px;
        }

        .box {
            margin-top: 20px;
        }
    </style>
</head>

<body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"
                    aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <!-- <a class="navbar-brand" href="#">Project name</a> -->
            </div>
            <div id="navbar" class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="#">问题页面</a></li>
                    <!-- <li><a href="#about">About</a></li>
                                <li><a href="#contact">Contact</a></li> -->
                </ul>

            </div>
            <!--/.nav-collapse -->
        </div>
    </nav>
    <div class="container container-box">
        <form>
            <input type="hidden" name="id" value="{{id}}">
            <textarea name="content" class="form-control" rows="10"></textarea>
            <div class="container box">
                <input type="submit" class="btn btn-success save" value="提&#x3000;交">
            </div>
        </form>

    </div>

    <script src="./lib/jquery.js"></script>
    <script src="./lib/js/bootstrap.js"></script>

    <script>
        $("form").submit(function(e){
            e.preventDefault();
            $.post("/question",$(this).serialize(),(res)=>{
                console.log(res);
                if(res.code == "success"){
                    location.href = "/"
                }else{
                    alert(res.msg);
                }
            })
        })
    </script>
</body>

</html>